import request from '../utils/request'

//获取当前登录人
export const GetLoginPersonName = () => {
    return request(`/api/my_employee_management`)
  }

//获取长庆单位名
export const GetCQCompany = () => {
    return request(`/api/chang_qin/company/tree/current`)
}

//获取检查记录
export const GetCQCheckRecord = (params) => {
  return request('/api/check_record', {
    params
  })
}

//获取查询记录id
export const GetCQCheckRecordID = (id) => {
  return request(`/api/check_record/${id}`)
}

//更新验收状态
export const UpdateCQAccept = ( data) => {
  return request(`/api/check_record`, {
    method: 'put',
    data
  })
}

//获取当前验证人未验证的检查记录
export const GetCQPersonNeedCheckRecord = (params) => {
  return request(`/api/check_record_verify/will`, {
    params
  })
}

//获取当前验证人未审核的检查记录
export const GetCQPersonNeedExamine = (params) => {
  return request(`/api/query_noveriy`, {
    params
  })
}

//获取当前登陆人未提交的问题
export const GetCQPersonNeedSubmit = (params) => {
  return request(`/api/queryCheckRecordByID`,{
    params
  })
}

//获取当前登录人已验证的检查记录
export const GetCQPersonCheckRecord = (params) => {
  return request(`/api/my_check_record_verify`, {
    params
  })
}

//根据单位获取整改人
export const CQGetSupervisor = (id) => {
  return request(`/api/querySubComEmployee/${id}`)
}

//获取验证人
export const CQGetverifyPerson = () => {
  return request(`/api/queryManageEmployee`)
}

//提交验证人
export const UpdateCQVerifyPerson = (data) => {
  return request(`/api/check_record/verify`, {
    method: 'put',
    data
  })
}

//删除待提交问题
export const DeleteCQNeedSubmit = (id) => {
  return request(`/api/deleteCheckRecordByID/${id}`,{
    method: 'delete'
  })
}

//修改待提交问题
export const UpdateCQNeedSubmit = (data) => {
  return request(`/api/updateCheckRecordByRecordID`, {
    method: 'put',
    data
  })
}

//查询检查表
export const GetCQCheckTable = (id) => {
  return request(`/api/completeCheckTable/${id}`)
}